import { axiosMock, delayFn, randArrItem } from '@/services/axiosMock'

axiosMock('default', mock => {
  // 检查运单号是否存在
  mock.onPost(`/tmsapi/waybill_record/checkWaybillNumber`).reply(
    delayFn(600, ({ data }) => {
      return {
        success: true,
        data: (data as string[]).map(() => randArrItem([true, true, false])),
      }
    }),
  )

  // 保存运单附件
  mock.onPost(`/tmsapi/waybill_record/uploadWaybillAttach`).reply(
    delayFn(600, () => {
      return {
        success: true,
      }
    }),
  )
})
